Skip to content

fix: cleaner user facing error handing and tests for config file points of failure - #620

Merged
michaelfaith merged 3 commits into
all-contributors:mainfrom
lwasser:readme-failures
Nov 12, 2026
Merged

michaelfaith merged 3 commits into
all-contributors:mainfrom
lwasser:readme-failures

Conversation

@lwasser

@lwasser lwasser commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

This PR adds e2e tests for points of failure when config files like the json file don't exist. here we raise a UserError and make the unit tests associated with it a bit more explicit too. this pr is built on #616 #617 .

@lwasser
lwasser force-pushed the readme-failures branch 3 times, most recently from 24be881 to 02dfe31 Compare November 11, 2026 01:48
@lwasser
lwasser marked this pull request as ready for review November 11, 2026 02:51
@lwasser
lwasser requested a review from a team November 11, 2026 02:55
@lwasser lwasser added the type: tests Changes to tests label Nov 11, 2026
@lwasser

lwasser commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

This is ready for review! Here I focused on various errors a user may encounter running initial commands so it looks at things like malformed json, bad config, missing readme, etc etc. i also added some friendlier messaging around errors and checked those in our tests too. I think the next round of tests will be related to mocking. i haven't been tracking these with issues but I will start doing that now.

Comment thread .github/workflows/test-deploy.yml Resolved
@michaelfaith

Copy link
Copy Markdown
Contributor

This will need to be rebased, following the re-organization of ci jobs.

@lwasser

lwasser commented Nov 11, 2026

Copy link
Copy Markdown
Member Author

@michaelfaith rebase is complete! thanks!

@lwasser lwasser changed the title test: add tests for config file points of failure fix: cleaner user facing error handing and tests for config file points of failure Nov 11, 2026
test: add await so error reach CLI error handler and throw proper returns

chore: lint

ci: add e2e to ci

test: add test and cleaner message for when json file is missing

test: cleanup unit test to check for UserError and match message

@michaelfaith michaelfaith left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good stuff! 👏

@michaelfaith
michaelfaith merged commit 0022c2e into all-contributors:main Nov 12, 2026
7 checks passed
@a-c-slater a-c-slater Bot mentioned this pull request Nov 12, 2026
michaelfaith pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.0.2](v7.0.1...v7.0.2)
(2026-11-12)


### 🩹 Bug Fixes

* cleaner user facing error handling and tests for config file points of
failure ([#620](#620))
([0022c2e](0022c2e))
* Readme error message should be user friendly not a quiet fail
([#617](#617))
([9c378f9](9c378f9))
* run git commands without a shell
([#588](#588))
([f9d3ee2](f9d3ee2))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: a-c-slater[bot] <354703433+a-c-slater[bot]@users.noreply.github.com>
michaelfaith pushed a commit that referenced this pull request Nov 12, 2026
closes #642 

this builds on #620 so i'll open as a draft and then when that merges,
open this one.
**What**:

This pr makes a small change to run-cli.js to allow us to capture the
output of `all-contributors` which displays a prompt that the user needs
to respond to (so it intentionally hangs) . To make sure the user sees a
prompt we force a "break" when text output is rendered on the screen and
make sure the text that we expect is there.

**Why**:

Cause tests are good. 🙃 
**How**:

- [ ] Documentation
- [x] Tests
- [x] Ready to be merged <!-- In your opinion, is this ready to be
merged as soon as it's reviewed? -->
- [ ] Added myself to contributors table <!-- this is optional, see the
contributing guidelines for instructions -->

<!-- feel free to add additional comments -->
@github-actions

Copy link
Copy Markdown

@all-contributors please add lwasser for code.

🤖 Beep boop! This comment was added automatically by all-contributors-auto-action.
Not all contributions can be detected from Git & GitHub alone. Please comment any missing contribution types this bot missed.
...and of course, thank you for contributing! 💙

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: tests Changes to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants